import 'package:flutter/material.dart';

class PaddingDemo extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(

      appBar: AppBar(title: Text('Padding And EdgeInsets'),),

      body: Container(

        color: Colors.brown,

        child: Column(

          children: <Widget>[

            ///主要记录 EdgeInsets 属性
            Padding(

              ///所有方向数值相同
                padding: EdgeInsets.all(10),
                child: Container(

                  width: double.infinity,
                  height: 100,
                  color: Colors.blueGrey,

                )),


            Padding(

              ///分别指定四个方向的padding
              padding: EdgeInsets.fromLTRB(20, 10, 15, 20),

              child: Container(

                width: double.infinity,
                height: 100,
                color: Colors.grey,
              ),
            ),

            Padding(

              ///可以指定单独方向，其他参数可以不填写
              padding: EdgeInsets.only(left: 30),
              child: Container(

                width: double.infinity,
                height: 100,
                color: Colors.green,
              ),
            ),

            Padding(

              ///用于设置对称方向的填充，vertical指top和bottom，horizontal指left和right
              padding: EdgeInsets.symmetric(horizontal: 15),
              child: Container(

                width: double.infinity,
                height: 100,
                color: Colors.blue,
              ),
            )

          ],
        ),
      ),
    );
  }
}